package com.tian.earth.ui.activity

import android.content.Intent
import android.os.Bundle
import com.tian.earth.constant.PreferenceConstants
import com.tian.earth.ui.activity.login.LoginActivity
import com.tian.earth.utils.PreferencesUtil
import com.tian.earth.utils.UserCenter

/**
 * @author tiansongtao, Email:769001510@qq.com
 * @date 19-6-28 下午3:48
 */
class SelectFirstActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        if (PreferencesUtil.INSTANCE.getBooleanValue(PreferenceConstants.START_FIRST)) {
            if (UserCenter.INSTANCE.isLogin()) {
                startActivity(Intent(this, MainActivity::class.java))
            } else {
                startActivity(Intent(this, LoginActivity::class.java))
            }
        } else {
            startActivity(Intent(this, BootStrapActivity::class.java))
        }
        finish()
    }

}